import { get, post } from '@/utils/request'

const prefix = 'plugins'

export default {
  /**
   * 抽奖详情
   */
  drawView: id => {
    return get(`${prefix}/draw/view`, {
      id: id
    })
  },
  /**
   * 投票详情
   */
  voteView: id => {
    return get(`${prefix}/vote/view`, {
      id: id
    })
  },
  /**
   * 投票项目列表
   */
  voteAims: id => {
    return get(`${prefix}/vote/aims`, {
      id: id
    })
  },
  /**
   * 提交投票
   */
  voteSubmit: data => {
    return post(`${prefix}/vote/create`, data, true)
  },
  /**
   * 抽取奖品
   */
  draw: data => {
    return post(`${prefix}/draw/extract`, data, true)
  }
}
